package org.altanovela.action;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import com.opensymphony.xwork2.ActionSupport;

@Results({
	@Result(name	 =WelcomeAction.RESULT_BASE, 
			type	 ="tiles", 
			location =WelcomeAction.RESULT_BASE),
	@Result(name	 =WelcomeAction.RESULT_OPT1, 
			type	 ="tiles", 
			location =WelcomeAction.RESULT_OPT1),
	@Result(name	 =WelcomeAction.RESULT_OPT2 , 
			type	 ="tiles",
			location =WelcomeAction.RESULT_OPT2)
})
public class WelcomeAction extends ActionSupport{
	private static final long serialVersionUID = 1L;
	
	// ACTION
	protected static final String ACTION_BASE = "index";
	protected static final String ACTION_OPT1 = "optionone";
	protected static final String ACTION_OPT2 = "optiontwo";
	
	// RESULT
	protected static final String RESULT_BASE = "BaseLayout";
	protected static final String RESULT_OPT1 = "OptionOne";
	protected static final String RESULT_OPT2 = "OptionTwo";
	
	/*
	 * ACTION HANDLER
	 */
	@Action(WelcomeAction.ACTION_OPT1)
	public String tiger(){
		return RESULT_OPT1;
	}
	
	@Action(WelcomeAction.ACTION_OPT2)
	public String lion(){
		return RESULT_OPT2;
	}
	
	@Action(WelcomeAction.ACTION_BASE)
	public String index(){
		return RESULT_BASE;
	}
}
